<?php

namespace Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;

class CustomerInfoFactory extends Factory
{
    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        $has_activity = random_int(0,10) < 5;

        return [
            'name' => $this->faker->name,
            'user_id' => $this->faker->numberBetween(2,10),
            'phone' => $this->faker->phoneNumber(),
            'vehicle_id' => $this->faker->numberBetween(1,10),
            'activity_id' => $has_activity ? $this->faker->numberBetween(1,10) : null,
            'province' => '江苏省',
            'city' => '南京市',
            'dealer_id' => $this->faker->numberBetween(1,5),
            'channel' => $this->faker->randomElement(['小程序','门店','公众号']),
        ];
    }
}
